Intersoft ClientUI Documentation
RegisterInstance<TType>(String,TType) Method



The type that is being registered for resolution.
The name this registration will be registered under.
The instance that will alway be returned when TType is resolved. The instance must be assignable to a variable of type TType.
Registers an instance that will be returned whenever the IocContainer resolves the specified type and name.
Syntax
Public Overloads Function RegisterInstance(Of TType As Class)( _
   ByVal name As String, _
   ByVal instance As TType _
) As IRegistration
Dim instance As IocContainer
Dim name As String
Dim instance As TType
Dim value As IRegistration
 
value = instance.RegisterInstance(Of TType)(name, instance)
public IRegistration RegisterInstance<TType>( 
   string name,
   TType instance
)
where TType: class
public:
IRegistration^ RegisterInstancegeneric<typename TType>
( 
   String^ name,
   TType^ instance
) 
where TType: ref class

Parameters

name
The name this registration will be registered under.
instance
The instance that will alway be returned when TType is resolved. The instance must be assignable to a variable of type TType.

Type Parameters

TType
The type that is being registered for resolution.

Return Value

An instance of IRegistration that can be used to configure how the get information about the registration, or change the lifetime manager.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IocContainer Class
IocContainer Members
Overload List

Send Feedback